<template>
  <div>
    <el-row style="text-align: center; margin: 10px 0;">
      <el-col :span="6">
        <el-button type="info" @click="handleMsg">发给自己消息</el-button>
      </el-col>
      <el-col :span="6">
        <el-button type="danger" @click="handleErrorMsg">发给自己失败消息</el-button>
      </el-col>
      <el-col :span="6">
        <el-button type="success" @click="handleSuccessMsg">发给自己成功消息</el-button>
      </el-col>
      <el-col :span="6">
        <el-button type="warning" @click="handleWarningMsg">发给自己警告消息</el-button>
      </el-col>
    </el-row>

    <el-row style="text-align: center; margin: 10px 0;">
      <el-col :span="6">
        <el-button type="info" @click="handleAlert">同步发给所有在线用户弹窗</el-button>
      </el-col>
      <el-col :span="6">
        <el-button type="danger" @click="handleErrorAlert">同步发给所有在线用户失败弹窗</el-button>
      </el-col>
      <el-col :span="6">
        <el-button type="success" @click="handleSuccessAlert">同步发给所有在线用户成功弹窗</el-button>
      </el-col>
      <el-col :span="6">
        <el-button type="warning" @click="handleWarningAlert">同步发给所有在线用户警告弹窗</el-button>
      </el-col>
    </el-row>

    <el-row style="text-align: center; margin: 10px 0;">
      <el-col :span="6">
        <el-button type="info" @click="handleNotifies">异步发给指定用户hz的提示</el-button>
      </el-col>
      <el-col :span="6">
        <el-button type="danger" @click="handleErrorNotify">异步发给指定用户hz的失败提示</el-button>
      </el-col>
      <el-col :span="6">
        <el-button type="success" @click="handleSuccessNotify">异步发给指定用户hz的成功提示</el-button>
      </el-col>
      <el-col :span="6">
        <el-button type="warning" @click="handleWarningNotify">异步发给指定用户hz的警告提示</el-button>
      </el-col>
    </el-row>

    <el-row style="text-align: center; margin: 10px 0;">
      <el-col :span="6">
        <el-button type="success" @click="handleIndex">给自己发一个提示同时同步给所有用户发消息</el-button>
      </el-col>
    </el-row>
  </div>
</template>

<script setup>
import socketApi from "@/api/socket";

function handleMsg() {
  socketApi.msg.get();
}

function handleErrorMsg() {
  socketApi.errorMsg.get();
}

function handleSuccessMsg() {
  socketApi.successMsg.get();
}

function handleWarningMsg() {
  socketApi.warningMsg.get();
}

function handleAlert() {
  socketApi.alert.get();
}

function handleErrorAlert() {
  socketApi.errorAlert.get();
}

function handleSuccessAlert() {
  socketApi.successAlert.get();
}

function handleWarningAlert() {
  socketApi.warningAlert.get();
}

function handleNotifies() {
  socketApi.notifies.get();
}

function handleErrorNotify() {
  socketApi.errorNotify.get();
}

function handleSuccessNotify() {
  socketApi.successNotify.get();
}

function handleWarningNotify() {
  socketApi.warningNotify.get();
}

function handleIndex() {
  socketApi.index.get();
}
</script>

<style scoped lang="scss">
</style>
